import static sun.swing.MenuItemLayoutHelper.max;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 123
 * Date: 2023-04-28
 * Time: 11:11
 */


public class Homework1 {

    public static void main(String[] args) {
        System.out.println(dgJc(5));
    }
    public static int dgJc(int n){
        if( n == 1){
            return 1;
        }
        else {
            return n*dgJc(n-1);
        }
    }



    public static void main5(String[] args) {
        System.out.println(add(1,2));
        System.out.println(add(1.0,2.0));
    }
    public static double add(double a,double b){
        return a+b;
    }

    public static int add(int a, int b){
        return a+b ;
    }



    public static void main4(String[] args) {
        System.out.println(fbNq(6));
    }

    public static int fbNq(int n){
        if(n == 1){
            return 0;
        }
        else if(n == 2 || n == 3){
            return 1;
        }
        else {
            return fbNq(n-1) + fbNq(n-2);
        }

    }


    public static void main3(String[] args) {
        System.out.println(jc(3));

    }

    public static int  jc(int n){

        int sum = 0;
        int j = 1;
        for(int i = 1; i <= n ; i++){
            j *= i;
            sum += j;
        }


        return  sum;

    }


    public static void main2(String[] args) {

        int a = 32;
        int b = 5;
        int c = 2;

        System.out.println(max(a,b));
        System.out.println(max(a,b,c));


    }

    public static void main6(String[] args) {
        System.out.println(max(2,3));
        System.out.println(max(3.3 ,3.4 ,6.3));
    }
    public static int max(int a , int b ){
        return a>b?a:b ;
    }
    public static double max(double a , double b ){
        return a>b?a:b ;
    }

    public static double max(double a,double b ,double c){
        return a>max(b,c)?a:max(b,c) ;
    }
    public static int max(int a, int b , int c ){

        return a>max(b,c)?a:max(b,c) ;
    }

}
